
class Base {

    String name;
    int age;
    public void eat() {
        System.out.println(name+" 在吃饭");
    }
}

class Dog extends Base {

   public void wangwang() {
    System.out.println(name+" 汪汪叫");
   }

}
 class Cat extends Base {

    public void mimi() {
     System.out.println(name+" 咪咪叫");
    }

}

public class Main {
 public static void main(String[] args) {
    Dog dog=new Dog();
    dog.name="小八嘎";
    dog.age=3;
     System.out.println(dog.name);
     System.out.println(dog.age);
    dog.eat();
    dog.wangwang();
    }
 }
